#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<windows.h>
#include<stdlib.h>
int my_atoi(char* str) {
    if (*str == '-') {
        int n = 0;
        str++;
        while(*str >= '0' && *str <= '9') {
            n = n * 10 + (*str - '0');
            str++;
        }
        return (-1) * n;
    }
    else if (*str == '+') {
        int n = 0;
        str++;
        while (*str >= '0' && *str <= '9') {
            n = n * 10 + (*str - '0');
            str++;
        }
        return  n;
    }
    else if (*str >= '0' && *str <= '9') {
        int n = *str - '0';
        str++;
        while (*str >= '0' && *str <= '9') {
            n = n * 10 + (*str - '0');
            str++;
        }
        return  n;
    }
    else return 0;
}
int main() {
    char arr[10] = "1234.12";
    char arr1[10] = "-1234.12";
    char arr2[10] = "+1234.12";
    printf("%d    %d     %d", my_atoi(arr), my_atoi(arr1), my_atoi(arr2));
    return 0;
}